

package com.maoshi.shop.distribution.comment.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.maoshi.shop.distribution.comment.dto.AchievementDataDto;
import com.maoshi.shop.distribution.comment.dto.DistributionUserAchievementDataDto;
import com.maoshi.shop.distribution.comment.dto.DistributionUserSimpleDto;
import com.maoshi.shop.distribution.comment.model.DistributionUser;
import com.maoshi.shop.distribution.comment.param.RangeTimeParam;
import com.maoshi.shop.distribution.comment.param.UpdateDistributionUserParam;
import org.apache.ibatis.annotations.Param;

/**
 *
 * @author lgh on 2019/04/01.
 */
public interface DistributionUserService extends IService<DistributionUser> {

    /**
     * 获取分销员用户信息
     * @param userId
     * @param shopId
     * @return
     */
    DistributionUser getByUserIdAndShopId(String userId,Long shopId);

    void removeCacheByUserIdAndShopId(String userId,Long shopId);

    /**
     * 根据分销员Id获取分销员信息
     * @param id
     * @return
     */
    AchievementDataDto getAchievementDataDtoById(Long id);

    /**
     * 获取分销员与等级条件匹配的数据
     * @param distributionUserId
     * @return
     */
    DistributionUserAchievementDataDto getDistributionUserLevelAchievementDataByDistributionUserId(@Param("distributionUserId") Long distributionUserId);

    IPage<DistributionUser> distributionUserPage(Page page, DistributionUser distributionUser, RangeTimeParam rangeTimeParam, String mobile, String parentMobile);


    void updateSelectiveAndInsertDistributionUserBan(UpdateDistributionUserParam param, Long modifier);

    IPage<DistributionUser> getDistributionUserAchievementPage(Page page,DistributionUser distributionUser,String userMobile);

    void registerDistributionUser(DistributionUser distributionUser);


    IPage<DistributionUserSimpleDto> getDistributionUserSimpleDtoByParentUserIdPage(Page page, Long parentDistributionUserId);


    DistributionUser getByCardNo(String cardNo);

    void removeCacheByCardNo(String cardNo);


}
